(C) 1996 AROS - The Amiga Replacement OS


NAME
LONG SPLog()
SYNOPSIS

LONG fnum1

LOCATION
In MathTransBase at offset 14
FUNCTION
Calculate logarithm (base 10) of the given ffp number

INPUTS
fnum1 - Motorola floating point number
RESULT
ffp-number

flags: zero : result is zero negative : result is negative overflow : argument was negative

NOTES
EXAMPLE
BUGS
SEE ALSO
INTERNALS
ALGORITHM:

If the Argument is negative set overflow-flag and return 0. If the Argument is 0 return 0xffffffff.

All other cases:

(ld is the logarithm with base 2) (ln is the logarithm with base e) fnum1 = M * 2^E

ln fnum1 = ln ( M * 2^E ) =

= ln M + ln 2^E =

= ln M + E * ln (2) =

ld M ld 2 = ----- + E * ----- = [ld 2 = 1] ld e ld e

ld M + E = -------- ld e

ld e can be precalculated, of course. For calculating ld M see file intern_spld.c

HISTORY
21.07.1997 bergers
*** empty log message ***